myApp.controller('SetCtrl', ['$scope','Session','FileUploader', function ($scope,Session,FileUploader) {
	console.log('SetCtrl loading');
	if($(window).width()<=414){
        $scope.mobile = true;
    }else{
        $scope.mobile = false;
    }

    $scope.User = Session.UserInfo;
    console.log($scope.User);


    $scope.openFile = function(){
    	$('#imgUpload').click();
    }

    var uploader = $scope.uploader = new FileUploader({
        url: '/users/logo'
    });
    $scope.fileupOk = function(){
        console.log('queue');
        console.log(uploader.queue);
        uploader.queue[0].upload();
    }
    uploader.onSuccessItem = function(fileItem, response, status, headers) {
        console.info('onSuccessItem', fileItem, response, status, headers);
    };
    uploader.onErrorItem = function(fileItem, response, status, headers) {
        console.info('onErrorItem', fileItem, response, status, headers);
    };      
}]);